<?php
/**
 * Stores one or more model instances to the database.
 * generates single instances or collection
 * @uses DbCollection
 * acts as Data Mapper and Unit Of Work
 * @link http://www.martinfowler.com/eaaCatalog/index.html
 *
 * uses standard MySQL library actually
 * @link http://webappkit.net
 * @package webappkit
 * @subpackage db
 * @author J.Ducastel <nospam0@ducastel.name>
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 */
class DbMapper {

    /**
     * gets a single instance by its id
     * @access public
     * @param string $id object id / primary key value
     * @param string $class class to be retrieved
     */
    function getObject($id, $class) {

    }

    /**
     * builds an object from result
     * @param resource $result as from mysql_query()
     * @param string $class object's class to build
     * @return object
     */
    function buildObject(&$result, $class) {
        // generic case
        return mysql_fetch_object($result, $class);
    }
}